package com.alibaba.webx.tutorial1.app1.web.screen.db;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.Date;

import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.citrus.turbine.dataresolver.Param;
import com.alibaba.webx.tutorial1.app1.service.RoleService;
import com.alibaba.webx.tutorial1.app1.vo.Role;
import com.sun.jmx.snmp.Timestamp;

public class update {
	
	@Autowired
    private HttpServletResponse response;
	
	@Autowired
	private RoleService roleService;
	
	public Boolean execute(
			@Param("roleId") Integer roleId,
			@Param("roleName") String roleName
			) throws Exception {
		Role role = new Role();
		role.setCreateTime(new Date(System.currentTimeMillis()));
		role.setUpdateTime(new Date(System.currentTimeMillis()));
		role.setId(roleId);
		role.setRoleName(roleName);
        return roleService.updateRole(role);
    }
}
